from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import WallPostViewSet, WallCommentView, WallStatsView

router = DefaultRouter()
router.register(r'posts', WallPostViewSet)

app_name = 'wall'

urlpatterns = [
    path('', include(router.urls)),
    path('stats/', WallStatsView.as_view(), name='wall-stats'),
    path('upload-image/', WallPostViewSet.as_view({'post': 'upload_image'}), name='upload-image'),
    
    # 评论相关
    path('posts/<int:post_id>/comments/', WallCommentView.as_view(), name='post-comments'),
    path('comments/', WallCommentView.as_view(), name='all-comments'),
    path('comments/<int:comment_id>/', WallCommentView.as_view(), name='comment-detail'),
] 